package com.oceansoft.mobile.econsole.modules.api.v2.service.impl;

import com.oceansoft.mobile.econsole.common.constant.Constant;
import com.oceansoft.mobile.econsole.modules.api.v2.service.IOrgService;
import com.oceansoft.mobile.econsole.modules.jlwt.entity.SysOrg;
import com.oceansoft.mobile.econsole.modules.jlwt.persistence.ISysOrgMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created by wzy on 2016/2/23.
 */
@Service
public class OrgServiceImpl implements IOrgService {
    @Resource
    private ISysOrgMapper sysOrgMapper;

    @Override
    public List<SysOrg> getOrgByParentGuid(String parentOrgId,String topGuid) {
        List<SysOrg> orgs = sysOrgMapper.getOrg(parentOrgId);
        if(parentOrgId==topGuid)
        {
            SysOrg org = sysOrgMapper.findByGuid(topGuid);
            orgs.add(org);
        }






        return  orgs;
    }
    @Override
    public String getOrgTemp3ByGuid(String orgId)
    {
        SysOrg org = sysOrgMapper.findByGuid(orgId);
        return  org.getTemp3();
    }
}
